import React from "react";
import { Button } from "antd";
import "../../../../../node_modules/antd/dist/antd.css";
import { useNavigate } from "react-router-dom";


export default function LogOut() {
 const navigate = useNavigate()
  return (
    <div id="logout">
      {/* 退出按钮 */}
      <Button
        style={{
          margin: " 0px 20px ",
          position: "fixed",
          bottom: "5px",
          zIndex: 101,
          backgroundColor: "#d43c33",
          borderColor: "#d43c33",
          width: "90%",
        }}
        type="primary"
        shape="round"
        size="middle"
        onClick={() => {
          localStorage.removeItem("token");
          navigate('/')
        }}
      >
        退出登录
      </Button>
    </div>
  );
}
